home *** CD-ROM | disk | FTP | other *** search
/ Programming a Multiplayer FPS in DirectX / Programming a Multiplayer FPS in DirectX (Companion CD).iso / DirectX / dxsdk_oct2004.exe / dxsdk.exe / Samples / C++ / Direct3D / PRTPerVertex / PRTOptionsDlg.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-09-27  |  3.9 KB  |  122 lines

  1. //--------------------------------------------------------------------------------------
  2. // File: PRTOptionsDlg.cpp
  3. //
  4. // Copyright (c) Microsoft Corporation. All rights reserved.
  5. //--------------------------------------------------------------------------------------
  6. #pragma once
  7.  
  8.  
  9. //--------------------------------------------------------------------------------------
  10. class CPRTOptionsDlg
  11. {
  12. public:
  13.     CPRTOptionsDlg(void);
  14.     ~CPRTOptionsDlg(void);
  15.  
  16.     SIMULATOR_OPTIONS* GetOptions();
  17.     HRESULT LoadOptions( WCHAR* strFile = NULL );
  18.     HRESULT SaveOptions( WCHAR* strFile = NULL );
  19.     void ResetSettings();
  20.  
  21.     bool Show();
  22.  
  23. protected:
  24.     HWND m_hDlg;
  25.     HWND  m_hToolTip;
  26.     HHOOK m_hMsgProcHook;
  27.     WCHAR m_strExePath[MAX_PATH];
  28.     BOOL m_bShowTooltips;
  29.     bool m_bComboBoxSelChange;
  30.  
  31.     static INT_PTR CALLBACK StaticDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
  32.     INT_PTR CALLBACK DlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam );
  33.  
  34.     void GetToolTipText( int nDlgId, NMTTDISPINFO* pNMTDI );
  35.  
  36.     static LRESULT CALLBACK GetMsgProc( int nCode, WPARAM wParam, LPARAM lParam );
  37.     static BOOL CALLBACK EnumChildProc( HWND hwnd, LPARAM lParam );
  38.  
  39.     void UpdateControlsWithSettings( HWND hDlg );
  40.  
  41. };
  42.  
  43. class CPRTLoadDlg
  44. {
  45. public:
  46.     CPRTLoadDlg(void);
  47.     ~CPRTLoadDlg(void);
  48.  
  49.     SIMULATOR_OPTIONS* GetOptions();
  50.  
  51.     bool Show();
  52.  
  53. protected:
  54.     HWND  m_hDlg;
  55.     HWND  m_hToolTip;
  56.     HHOOK m_hMsgProcHook;
  57.  
  58.     static INT_PTR CALLBACK StaticDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
  59.     INT_PTR CALLBACK DlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam );
  60.  
  61.     void GetToolTipText( int nDlgId, NMTTDISPINFO* pNMTDI );
  62.  
  63.     static LRESULT CALLBACK GetMsgProc( int nCode, WPARAM wParam, LPARAM lParam );
  64.     static BOOL CALLBACK EnumChildProc( HWND hwnd, LPARAM lParam );
  65. };
  66.  
  67. class CPRTAdaptiveOptionsDlg
  68. {
  69. public:
  70.     CPRTAdaptiveOptionsDlg(void);
  71.     ~CPRTAdaptiveOptionsDlg(void);
  72.  
  73.     bool Show( HWND hDlg );
  74.  
  75. protected:
  76.     HWND  m_hDlg;
  77.     HWND  m_hToolTip;
  78.     HHOOK m_hMsgProcHook;
  79.  
  80.     static INT_PTR CALLBACK StaticDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
  81.     INT_PTR CALLBACK DlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam );
  82.  
  83.     void UpdateUI( HWND hDlg );
  84.     void GetToolTipText( int nDlgId, NMTTDISPINFO* pNMTDI );
  85.  
  86.     static LRESULT CALLBACK GetMsgProc( int nCode, WPARAM wParam, LPARAM lParam );
  87.     static BOOL CALLBACK EnumChildProc( HWND hwnd, LPARAM lParam );
  88. };
  89.  
  90. class COptionsFile
  91. {
  92. public:
  93.     COptionsFile();
  94.     ~COptionsFile();
  95.  
  96.     WCHAR m_strFile[MAX_PATH];
  97.     SIMULATOR_OPTIONS m_Options;
  98.  
  99.     HRESULT LoadOptions( WCHAR* strFile = NULL );
  100.     HRESULT SaveOptions( WCHAR* strFile = NULL  );
  101.     void ResetSettings();
  102. };
  103.  
  104. SIMULATOR_OPTIONS& GetGlobalOptions();
  105. COptionsFile& GetGlobalOptionsFile();
  106.  
  107. class CXMLHelper
  108. {
  109. public:
  110.     static void CreateNewValue( IXMLDOMDocument* pDoc, IXMLDOMNode* pNode, WCHAR* strName, WCHAR* strValue );
  111.     static void CreateNewValue( IXMLDOMDocument* pDoc, IXMLDOMNode* pNode, WCHAR* strName, DWORD nValue );
  112.     static void CreateNewValue( IXMLDOMDocument* pDoc, IXMLDOMNode* pNode, WCHAR* strName, float fValue );
  113.     static void CreateChildNode( IXMLDOMDocument* pDoc, IXMLDOMNode* pParentNode, WCHAR* strName, int nType, IXMLDOMNode** ppNewNode );
  114.     static void GetValue( IXMLDOMNode* &pNode, WCHAR* strName, WCHAR* strValue );
  115.     static void GetValue( IXMLDOMNode* &pNode, WCHAR* strName, int* pnValue );
  116.     static void GetValue( IXMLDOMNode* &pNode, WCHAR* strName, bool* pbValue );
  117.     static void GetValue( IXMLDOMNode* &pNode, WCHAR* strName, float* pfValue );
  118.     static void GetValue( IXMLDOMNode* &pNode, WCHAR* strName, D3DXCOLOR* pclrValue );
  119.     static void GetValue( IXMLDOMNode* &pNode, WCHAR* strName, DWORD* pdwValue );
  120. };
  121.  
  122.